# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=bios_memimage
pkgver=1.2
pkgrel=3
pkgdesc='A tool to dump RAM contents to disk (aka cold boot attack).'
arch=('x86_64' 'aarch64')
url='http://citp.princeton.edu/memory/code/'
license=('BSD')
groups=('blackarch' 'blackarch-cracker' 'blackarch-forensic')
options=('!makeflags')
source=("http://citpsite.s3-website-us-east-1.amazonaws.com/oldsite-htdocs/memory-content/src/bios_memimage-$pkgver.tar.gz")
sha512sums=('af358cdb5a2e35cc3434ddfd74d10147c55483951f37c193513de29df50fba8be9817b21b65417dd5124de13007fd5f0e7805406ac3f4e9ac7da21f3864c506e')

build() {
  cd $pkgname

  machine="`uname -m`"

  if [ "$machine" = "x86_64" ]
  then
    make -f Makefile.64 -C stand
    make -f Makefile.64
  else
    make
  fi
}

package() {
  cd $pkgname

  install -Dm 755 "pxedump/pxedump" \
    "$pkgdir/usr/bin/pxedump"
  install -Dm 755 "usbdump/usbdump" \
    "$pkgdir/usr/bin/usbdump"
  install -Dm 644 "pxe/scraper.bin" \
    "$pkgdir/usr/share/$pkgname/pxe/scraper.bin"
  install -Dm 644 "usb/scraper.bin" \
    "$pkgdir/usr/share/$pkgname/usb/scraper.bin"
  install -Dm 644 "doc/readme.txt" \
    "$pkgdir/usr/share/doc/$pkgname/readme.txt"
  install -Dm 644 "doc/faq.txt" \
    "$pkgdir/usr/share/doc/$pkgname/faq.txt"
}

